


<script setup>
import {ref, reactive} from 'vue'

const obj = reactive({
    nested: { count: 0 },
    arr: ['foo', 'bar']
})

function mutateDeeply() {
    // 以下都会按照期望工作
    obj.nested.count++
    obj.arr.push('baz')
}
</script>

<template>
    <button @click="mutateDeeply">按钮</button>
    <p>{{obj}}</p>
    <p>{{obj.nested}}</p>
    <p>{{obj.arr}}</p>
</template>